<template>
  <div class="noticeDetail">
    <van-sticky>
      <div class="detailHeader">
        <van-icon name="arrow-left" @click="back" class="backIcon" />
        <div></div>
      </div>
    </van-sticky>
    <div class="bottomContent">
      <h1>{{ list.title }}</h1>
      <div class="DetailTime">
        <span>时间：</span>{{ list.createTime }}
      </div>
      <p v-html="list.content"></p>
    </div>
  </div>
</template>

<script>
import { NoticeDetailApi } from "@/service/metro/metroservice.js";
export default {
  data() {
    return {
      list: []
    };
  },
  methods: {
    back() {
      this.$router.go(-1);
    },
    async getDetailList() {
      let detailId = this.$route.query.id;
      let { data } = await NoticeDetailApi(detailId);
      console.log(data);
      if(data.code == 200) {
        this.list = data.data
      }
    },
  },
  created() {
    this.getDetailList();
  },
};
</script>

<style lang="scss" scoped>
.noticeDetail {
  font-size: 20px;
  padding-bottom: 55px;
  .detailHeader {
    background-color: #fff;
    height: 45px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    .backIcon {
      font-size: 20px;
    }
  }
  .bottomContent {
    padding: 0px 5px 5px 5px;
    .DetailTime {
      color: #666;
      font-size: 16px;
      text-align: right;
      margin-right: 30px;
      margin-top: 10px;
      margin: 20px 20px 10px 0px;
      span {
        color: #000;
      }
    }
    h1 {
      font-size: 24px;
      margin-top: 10px;
    }
  }
}
</style>